Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(auction): upgrade handler and params #2526

Merged
merged 9 commits into from
May 16, 2024
Merged

Conversation

robert-zaremba
Copy link
Member

Description

Before merging need to decide about default params for leverage and metoken

@robert-zaremba robert-zaremba requested a review from a team as a code owner May 15, 2024 14:34
Copy link
Contributor

coderabbitai bot commented May 15, 2024

Warning

Rate Limit Exceeded

@robert-zaremba has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 8 minutes and 43 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between 1d0b9d4 and f60a9ce.

Walkthrough

The changes involve introducing a new upgrade v6.5 to the Umee network, focusing on updating parameters for leverage and metoken modules to include a burn auction fee share. This includes renaming fields and adjusting calculations related to auction fees across various files to accommodate the new fee structure.

Changes

Files/Paths Change Summaries
app/upgrades.go Added v6.5 upgrade registration, updated leverage and metoken module parameters for burn auction fee.
proto/umee/leverage/v1/leverage.proto Renamed rewards_auction_factor to rewards_auction_fee in Params message with clarified comment.
proto/umee/metoken/v1/metoken.proto Renamed rewards_auction_factor to rewards_auction_fee_factor in Params message.
x/leverage/fixtures/params.go Renamed RewardsAuctionFactor to RewardsAuctionFee in Params function.
x/leverage/keeper/interest.go Updated DeriveSupplyAPY and AccrueAllInterest functions to use RewardsAuctionFee.
x/leverage/keeper/interest_test.go Updated comment in TestAccrueZeroInterest function to reflect change to RewardsAuctionFee.
x/leverage/types/params.go Modified RewardsAuctionFactor value from 0.02 to 0.20 in DefaultParams function.
x/metoken/keeper/intest/msg_server_test.go Updated verifySwap and verifyRedeem functions to use RewardsAuctionFeeFactor for fee calculation.
x/metoken/keeper/swap.go Updated breakFee function to use RewardsAuctionFeeFactor for toAuction calculation.
x/metoken/keeper/swap_test.go Updated TestSwap_Valid and TestBreakFees functions to use RewardsAuctionFeeFactor.
x/metoken/params.go Adjusted RewardsAuctionFactor value from 10% to 100% in DefaultParams function.

🐇
In the code where numbers dance,
A rabbit found a chance,
To tweak the fees, to change the name,
Ensuring auctions aren't the same.
With v6.5, we leap ahead,
In Umee's world, well-fed.
🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between a32c546 and 29ba0f4.
Files selected for processing (3)
  • app/upgrades.go (2 hunks)
  • x/leverage/types/params.go (1 hunks)
  • x/metoken/params.go (1 hunks)
Additional Context Used
GitHub Check Runs (8)
test-unit-cover failure (8)

app/upgrades.go: [failure] 86-86:
syntax error: unexpected newline in composite literal; possibly missing comma or }

umeed linux-arm64 cancelled (3)

app/upgrades.go: [failure] 86-86:
syntax error: unexpected newline in composite literal; possibly missing comma or }

umeed darwin-arm64 failure (3)

app/upgrades.go: [failure] 86-86:
syntax error: unexpected newline in composite literal; possibly missing comma or }

umeed linux-amd64 failure (3)

app/upgrades.go: [failure] 86-86:
syntax error: unexpected newline in composite literal; possibly missing comma or }

umeed darwin-amd64 failure (3)

app/upgrades.go: [failure] 86-86:
syntax error: unexpected newline in composite literal; possibly missing comma or }

test-app-non-determinism failure (3)

app/upgrades.go: [failure] 86-86:
syntax error: unexpected newline in composite literal; possibly missing comma or }

Run golangci-lint failure (8)

app/upgrades.go: [failure] 86-86:
syntax error: unexpected newline in composite literal; possibly missing comma or } (typecheck)


app/upgrades.go: [failure] 86-86:
missing ',' before newline in composite literal (typecheck)


app/upgrades.go: [failure] 86-86:
syntax error: unexpected newline in composite literal; possibly missing comma or }) (typecheck)


app/upgrades.go: [failure] 86-86:
syntax error: unexpected newline in composite literal; possibly missing comma or }) (typecheck)

Run govulncheck failure (6)

app/upgrades.go: [failure] 86-86:
missing ',' before newline in composite literal


app/upgrades.go: [failure] 70-70:
not enough return values


app/upgrades.go: [failure] 77-77:
not enough return values


app/upgrades.go: [failure] 85-85:
undefined: auction

Additional comments not posted (3)
x/metoken/params.go (1)

8-8: LGTM! The RewardsAuctionFactor update aligns with the PR objectives.

x/leverage/types/params.go (1)

15-15: LGTM! The RewardsAuctionFactor update aligns with the PR objectives.

app/upgrades.go (1)

55-57: LGTM! The addition of registerUpgrade6_5 aligns with the PR objectives.

app/upgrades.go Outdated Show resolved Hide resolved
app/upgrades.go Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 29ba0f4 and aae72f6.
Files selected for processing (1)
  • app/upgrades.go (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • app/upgrades.go

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between aae72f6 and 15d9dbe.
Files ignored due to path filters (2)
  • swagger/swagger.yaml is excluded by !**/*.yaml
  • x/metoken/metoken.pb.go is excluded by !**/*.pb.go, !**/*.pb.go
Files selected for processing (6)
  • app/upgrades.go (2 hunks)
  • proto/umee/metoken/v1/metoken.proto (1 hunks)
  • x/metoken/keeper/intest/msg_server_test.go (2 hunks)
  • x/metoken/keeper/swap.go (1 hunks)
  • x/metoken/keeper/swap_test.go (2 hunks)
  • x/metoken/params.go (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • app/upgrades.go
  • x/metoken/params.go
Additional comments not posted (4)
x/metoken/keeper/swap_test.go (2)

44-44: Update parameter name to RewardsAuctionFeeFactor.

The change correctly updates the parameter name to RewardsAuctionFeeFactor in the assertion.


91-91: Update parameter name to RewardsAuctionFeeFactor.

The change correctly updates the parameter name to RewardsAuctionFeeFactor in the assertion.

proto/umee/metoken/v1/metoken.proto (1)

22-26: Rename field to rewards_auction_fee_factor.

The field name change to rewards_auction_fee_factor is correct, and the comments accurately describe the field.

x/metoken/keeper/swap.go (1)

188-189: Update parameter name to RewardsAuctionFeeFactor.

The change correctly updates the parameter name to RewardsAuctionFeeFactor in the fee calculation.

@robert-zaremba robert-zaremba changed the title DNM: feat(auction): upgrade handler and params feat(auction): upgrade handler and params May 16, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 15d9dbe and 73a552e.
Files ignored due to path filters (3)
  • swagger/swagger.yaml is excluded by !**/*.yaml
  • x/leverage/types/leverage.pb.go is excluded by !**/*.pb.go, !**/*.pb.go
  • x/metoken/metoken.pb.go is excluded by !**/*.pb.go, !**/*.pb.go
Files selected for processing (8)
  • app/upgrades.go (2 hunks)
  • proto/umee/leverage/v1/leverage.proto (1 hunks)
  • proto/umee/metoken/v1/metoken.proto (1 hunks)
  • x/leverage/fixtures/params.go (1 hunks)
  • x/leverage/keeper/interest.go (2 hunks)
  • x/leverage/keeper/interest_test.go (1 hunks)
  • x/leverage/types/params.go (1 hunks)
  • x/metoken/params.go (1 hunks)
Files not reviewed due to errors (3)
  • x/leverage/keeper/interest_test.go (no review received)
  • x/leverage/keeper/interest.go (no review received)
  • proto/umee/leverage/v1/leverage.proto (no review received)
Files skipped from review due to trivial changes (1)
  • x/leverage/fixtures/params.go
Files skipped from review as they are similar to previous changes (3)
  • app/upgrades.go
  • proto/umee/metoken/v1/metoken.proto
  • x/leverage/types/params.go
Additional comments not posted (1)
x/metoken/params.go (1)

6-8: LGTM! The default value for RewardsAuctionFeeFactor has been updated to 100%.

@robert-zaremba robert-zaremba enabled auto-merge May 16, 2024 08:22
@robert-zaremba robert-zaremba force-pushed the robert/auction-upgrade branch from 73a552e to e4d4427 Compare May 16, 2024 08:27
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 73a552e and e4d4427.
Files selected for processing (1)
  • app/upgrades.go (2 hunks)
Additional Context Used
GitHub Check Runs (7)
umeed linux-arm64 failure (3)

app/upgrades.go: [failure] 27-27:
"github.com/umee-network/umee/v6/x/metoken" imported and not used

umeed darwin-arm64 failure (3)

app/upgrades.go: [failure] 27-27:
"github.com/umee-network/umee/v6/x/metoken" imported and not used

umeed linux-amd64 failure (3)

app/upgrades.go: [failure] 27-27:
"github.com/umee-network/umee/v6/x/metoken" imported and not used

umeed darwin-amd64 failure (3)

app/upgrades.go: [failure] 27-27:
"github.com/umee-network/umee/v6/x/metoken" imported and not used

Run golangci-lint failure (7)

app/upgrades.go: [failure] 27-27:
"github.com/umee-network/umee/v6/x/metoken" imported and not used (typecheck)


app/upgrades.go: [failure] 27-27:
"github.com/umee-network/umee/v6/x/metoken" imported and not used) (typecheck)


app/upgrades.go: [failure] 27-27:
"github.com/umee-network/umee/v6/x/metoken" imported and not used) (typecheck)

test-app-non-determinism failure (3)

app/upgrades.go: [failure] 27-27:
"github.com/umee-network/umee/v6/x/metoken" imported and not used

Run govulncheck failure (3)

app/upgrades.go: [failure] 27-27:
"github.com/umee-network/umee/v6/x/metoken" imported and not used

Additional comments not posted (2)
app/upgrades.go (2)

57-57: LGTM! The addition of registerUpgrade6_5 is consistent with the existing pattern.


60-88: LGTM! The registerUpgrade6_5 function correctly updates the leverage and metoken parameters and handles errors appropriately.

app/upgrades.go Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between e4d4427 and 1d0b9d4.
Files selected for processing (1)
  • app/upgrades.go (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • app/upgrades.go

Copy link

codecov bot commented May 16, 2024

Codecov Report

Attention: Patch coverage is 57.14286% with 12 lines in your changes are missing coverage. Please review.

Project coverage is 62.77%. Comparing base (7f05ad4) to head (f60a9ce).
Report is 476 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #2526       +/-   ##
===========================================
- Coverage   75.38%   62.77%   -12.62%     
===========================================
  Files         100      275      +175     
  Lines        8025    15889     +7864     
===========================================
+ Hits         6050     9975     +3925     
- Misses       1589     5141     +3552     
- Partials      386      773      +387     
Files Coverage Δ
x/leverage/fixtures/params.go 100.00% <100.00%> (ø)
x/leverage/keeper/interest.go 70.87% <100.00%> (+7.44%) ⬆️
x/leverage/types/params.go 100.00% <100.00%> (+1.78%) ⬆️
x/metoken/keeper/swap.go 65.54% <100.00%> (ø)
x/metoken/params.go 100.00% <100.00%> (ø)
app/upgrades.go 48.12% <40.00%> (ø)

... and 231 files with indirect coverage changes

@robert-zaremba robert-zaremba added the skip-e2e-test Skip the e2e tests label May 16, 2024
@robert-zaremba robert-zaremba added this pull request to the merge queue May 16, 2024
Merged via the queue into main with commit 682c059 May 16, 2024
33 of 40 checks passed
@robert-zaremba robert-zaremba deleted the robert/auction-upgrade branch May 16, 2024 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-e2e-test Skip the e2e tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants